﻿<%@ Page Language="C#" MasterPageFile="~/Views/Shared/Metodesa.Master" AutoEventWireup="true" CodeBehind="ListProducto.aspx.cs" Inherits="Metodesa.Views.Home.ListProducto" Title="Untitled Page" %>
<asp:Content ID="Content1" ContentPlaceHolderID="MainContentPlaceHolder" runat="server">
<asp:TextBox ID="searchbox" runat="server"></asp:TextBox>
    
  
    &nbsp;<asp:Button ID="FindButton" runat="server" Text="Buscar" 
        PostBackUrl="~/Views/Home/ListProducto.aspx?" CausesValidation="False" onclick="FindButton_Click" 
        /> 
    &nbsp;&nbsp;&nbsp;&nbsp;<asp:Button ID="PrepareAddButton" runat="server" Text="Agregar" 
        PostBackUrl="~/Views/Home/ListProducto.aspx?a=p" CausesValidation="False" onclick="PrepareAddButton_Click1" 
       />
     <asp:RadioButtonList ID="option" runat="server">
        <asp:ListItem Value="Categoria">Categoria</asp:ListItem>
        <asp:ListItem Value="Name">Nombre</asp:ListItem>
    </asp:RadioButtonList>



  <asp:Panel ID="ListProductos" runat="server" Visible="False">
     <p>&nbsp;</p>

     </asp:Panel>
     
     <br />
    
    <asp:Label ID="label" runat="server" Text="Label" Visible="False"></asp:Label>

    <div>
    <asp:Panel ID="PanelEditProducto" runat="server" Visible="False">
    <p>&nbsp;</p>
        <table style="width:481px;">
            
      
                <tr>
                    <td style="width: 24px">
                        Id</td>
                    <td style="width: 90px">
                        Nombre <font color="red">*</font></td>
                    <td style="width: 90px">
                        Categoria <font color="red">*</font></td>
                    <td style="width: 90px">
                        Precio <font color="red">*</font></td>
                    
                </tr>
                <tr>
                    <td style="width: 24px">
                        <asp:Label ID="teId" runat="server" Width="24px"/>
                    </td>
                    <td style="width: 87px">
                        <asp:TextBox ID="teName" runat="server" Width="87px"></asp:TextBox>
                        <asp:RequiredFieldValidator id="ValidateName" runat="server" ErrorMessage="Introduzca un nombre"  ControlToValidate="teName" Display="Dynamic"></asp:RequiredFieldValidator>
                    
                    </td>
                    <td style="width: 87px">
                        <asp:TextBox ID="teCategory" runat="server" Width="87px"></asp:TextBox>
                        <asp:RequiredFieldValidator id="ValidaCategory" runat="server" ErrorMessage="Introduzca una categoria"  ControlToValidate="teCategory" Display="Dynamic"></asp:RequiredFieldValidator>
                    </td>
                    <td style="width: 87px">
                        <asp:TextBox ID="tePrice" runat="server" Width="87px"></asp:TextBox>
                        <asp:RequiredFieldValidator id="ValidatePrice" runat="server" ErrorMessage="Introduzca un Precio"  ControlToValidate="tePrice" Display="Dynamic"></asp:RequiredFieldValidator>
                        <asp:RegularExpressionValidator ID="ValidatorPrecio2" runat="server"     
                                    ControlToValidate="tePrice"   
                                     Display="Dynamic" />
                    </td>                   
                </tr>
                <tr>
                    <td align="center" colspan="2">
                        <asp:Button ID="EditButton" runat="server" 
                            PostBackUrl="~/Views/Home/ListProducto.aspx?a=e" Text="Modificar" 
                            onclick="EditButton_Click" />
                    </td>
                </tr>
            
           
        </table>
     
  
    </asp:Panel>
    
    <asp:Panel ID="PanelAddProducto" runat="server" Visible="False">
    <p>&nbsp;</p>
        <table style="width:481px;">
            
      
                <tr>
                    
                    <td style="width: 90px">
                        Nombre <font color="red">*</font></td>
                    <td style="width: 90px">
                        Categoria <font color="red">*</font></td>
                    <td style="width: 90px">
                        Precio <font color="red">*</font></td>
                    
                </tr>
                <tr>
                    
                    <td style="width: 87px">
                        <asp:TextBox ID="taName" runat="server" Width="87px"></asp:TextBox>
                        <asp:RequiredFieldValidator id="RequiredFieldValidator1" runat="server" ErrorMessage="Introduzca un nombre"  ControlToValidate="taName" Display="Dynamic"></asp:RequiredFieldValidator>
                    </td>
                    <td style="width: 87px">
                        <asp:TextBox ID="taCategory" runat="server" Width="87px"></asp:TextBox>
                        <asp:RequiredFieldValidator id="RequiredFieldValidator2" runat="server" ErrorMessage="Introduzca una categoria"  ControlToValidate="taCategory" Display="Dynamic"></asp:RequiredFieldValidator>
                    </td>
                    <td style="width: 87px">
                        <asp:TextBox ID="taPrice" runat="server" Width="87px"></asp:TextBox>
                        <asp:RequiredFieldValidator id="RequiredFieldValidator3" runat="server" ErrorMessage="Introduzca un Precio"  ControlToValidate="taPrice" Display="Dynamic"></asp:RequiredFieldValidator>
                        <asp:RegularExpressionValidator ID="ValidatorPrecio1" runat="server"     
                                    ControlToValidate="taPrice"   
                                     Display="Dynamic" />
                    </td>                   
                </tr>
                <tr>
                    <td align="center" colspan="2">
                        <asp:Button ID="AddButton" runat="server" 
                            PostBackUrl="~/Views/Home/ListProducto.aspx?a=a" Text="Agregar" 
                            onclick="AddButton_Click" />
                    </td>
                </tr>
            
           
        </table>
     
  
    </asp:Panel>
    
</div>


</asp:Content>
